﻿@model Models.DataModel.UserAccount
@{
    ViewBag.Title = "AddUser";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>AddUser</h2>
<h4 style="margin-left:200px;color:red">@ViewBag.Usernamematch</h4>
@using (Html.BeginForm("AddUser", "UserAccount", FormMethod.Post, new { @class = "form-horizontal", role = "form", name = "dataupload", id = "dataupload", onsubmit = "return CheckInput();" }))
{
    
    @Html.ValidationSummary();
    <div class="">
        <div class="col-xs-12 col-sm-6 col-md-2">@Html.Label("UserName")</div>
        <div class="col-xs-6 col-md-10">@Html.TextBoxFor(c => c.UserName)<em class="error" id="user" style="display:none;">Please input your Username</em></div><br />
    </div><br />
    <div class="">
        <div class="col-xs-12 col-sm-6 col-md-2">@Html.Label("Password")</div>
        <div class="col-xs-6 col-md-10">@Html.PasswordFor(c => c.Password)<em class="error" id="pass" style="display:none;">Please input your password</em></div><br />
        
    </div><br />
    
    <div class="">
        <div class="col-xs-12 col-sm-6 col-md-2">@Html.Label("First Name")</div>
        <div class="col-xs-6 col-md-4">@Html.TextBoxFor(c => c.FirstName)</div><br />
    </div><br />
    <div class="">
        <div class="col-xs-12 col-sm-6 col-md-2">@Html.Label("Last Name")</div>
        <div class="col-xs-6 col-md-4">@Html.TextBoxFor(c => c.LastName)</div><br />
    </div><br />
    <div class="">
        <div class="col-xs-12 col-sm-6 col-md-2">@Html.Label("Full Name")</div>
        <div class="col-xs-6 col-md-4">@Html.TextBoxFor(c => c.FullName)</div><br />
    </div><br />
    <div class="">
        <div class="col-xs-12 col-sm-6 col-md-2">@Html.Label("Birthday")</div>
        <div class="col-xs-6 col-md-4">@Html.TextBoxFor(c => c.Birthday)</div><br />
    </div><br />
    <div class="">
        <div class="col-xs-12 col-sm-6 col-md-2">@Html.Label("Email")</div>
        <div class="col-xs-6 col-md-4">@Html.TextBoxFor(c => c.Email)</div><br />
    </div><br />
    <div class="">
        <div class="col-xs-12 col-sm-6 col-md-2">@Html.Label("Decription")</div>
        <div class="col-xs-6 col-md-4">@Html.TextBoxFor(c => c.Description)</div><br />
    </div><br />
        <div class="">
        <div class="col-xs-12 col-sm-6 col-md-2">@Html.Label("GroupUserId")</div>
        <div class="col-xs-6 col-md-4">@Html.DropDownListFor(c => c.GroupUserID, ViewBag.lstGroupUser as SelectList)</div><br />
    </div><br />
        <div class="">
        <div class="col-xs-12 col-sm-6 col-md-2">@Html.Label("Active")</div>
        <div class="col-xs-6 col-md-4">@Html.CheckBox("Activevalue")</div><br />
    </div><br />
    <input type="submit" value="Add" id="btnAdd" class="btn btn-primary" style="margin-left:200px" />
}

<script type="text/javascript">
    $("#btnAdd").click(function () {
        var username = $("#UserName").val().trim();
        var Password = $("#Password").val().trim();
        if (username == "") {
            $("#user").css("display", "block");
            return false;
        }
        if (Password == "") {
            $("#pass").css("display", "block");
            return false;
        }
    });
</script>
